Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Creating a dynamic browse
The most complex graphical object is the browse object. You can create a browse dynamically and specify programmatically all its attributes, including what table and query’s records are displayed, what columns it displays, which columns are enabled for input, and its visible attributes such as size and position.
You can assign most of a dynamic browse’s attributes in the
CREATE BROWSEstatement:
In addition, you can specify some attribute values individually following the
CREATEstatement:
Here are some of the principal attributes you can set either in the
CREATE BROWSEstatement or in a separate assignment on the browse handle:
FRAME— You must associate the browse with a frame it is visualized in.- X and Y, or ROW and COLUMN — You should specify a position for the browse. Otherwise, it is positioned in the upper-left corner of the frame. As for other objects,
XandYare in pixels,ROWandCOLUMNare in character rows.- WIDTH or WIDTH-PIXELS — You should specify a width for the browse using the
WIDTHattribute in characters or theWIDTH-PIXELSattribute in pixels.- HEIGHT, HEIGHT-PIXELS or DOWN — You should specify a height for the browse using either the character
HEIGHTorHEIGHT-PIXELSattribute or theDOWNattribute.DOWNspecifies the number of rows to display. Keep in mind that if you use theHEIGHTorHEIGHT-PIXELSattribute, then any horizontal scrollbar uses part of that height. The overall height of the browse remains the same whether there is a horizontal scrollbar or not. If you specifyDOWN, that determines the number of rows of data to display, and any horizontal scrollbar is added to that height.ROW-HEIGHT— Set this decimal attribute if you want each row to be different from the default, which is calculated based on the font.SENSITIVE— You should generally make a browse sensitive so that the user can use the scroll bar.QUERY— You must provide the browse with the handle of a query that provides its data to display.VISIBLEorHIDDEN— You must set eitherHIDDENto false, if you want the browse to be viewed when its parent frame if viewed, orVISIBLEto true to force the frame and the browse to be viewed.READ-ONLY— Set this option to true if you are not going to enable columns in the browse.SEPARATORS— Set this option to true if you want lines between the columns and rows of the browse.ROW-MARKERS— Set this option to false if you do not want row markers at the beginning of each row.NO-VALIDATE— Set this option to true to prevent Progress from compiling field-level validation phrases from the schema into the browse.TITLE— Set this string if you want the browse to have a title bar.MULTIPLE— Set this option to true if you want to enable multiple selection of rows.Some attributes can only be assigned before the browse is realized. In the case of a dynamic browse, this is generally when the browse is made visible, which you can do in one of two ways:
In a
CREATE BROWSEstatement, the attributes of the browse in theASSIGNlist are assigned in sequence. So, as this single statement is executed, if Progress encounters theVISIBLE = TRUEorHIDDEN = FALSEphrases (and its parent frame is visible), the browse is realized at that time. If you try to assign an attribute later in the statement, or in a separate statement, which has to be assigned before the browse is realized, you get an error at run time. For example, if you don’t want the browse to have row markers at the beginning of each row, you set theROW-MARKERSattribute toFALSE. If you put this assignment into theCREATEstatement after an attribute that realizes the browse, you get the error shown in Figure 18–15.Figure 18–15: ROW-MARKERS error message
![]()
If this occurs, you have to reorder the assignments in the
CREATE BROWSEstatement. Generally, you should put the assignment that realizes the browse at the end of the statement or in a separate attribute assignment statement.In the same way, you can modify most attributes in separate statements after the browse has been realized, except for attributes such as
ROW-MARKERS.The one thing you cannot set within the
CREATE BROWSEstatement is the list of columns to display. There are three methods on the browse handle that set the column list after the browse has been created.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |